﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ORMAC.CodeGen;
using ORMAC.UI.WPF.ViewModel;

namespace ORMAC.UI.WPF.Views
{
    /// <summary>
    /// Interaction logic for WindowSelectTable.xaml
    /// </summary>
    public partial class SelectObjectsForm : Window,IWizardForm
    {
        public SelectObjectsForm(SelectObjectsViewModel vm)
        {
            InitializeComponent();
            this.DataContext = vm;
        }

        private void buttonNext_Click(object sender, RoutedEventArgs e)
        {
            result = WizardFormResult.Next;
            this.Close();
        }
        private WizardFormResult result;
        public WizardFormResult Result
        {
            get
            {
                return result;
            }
        }
        public WizardFormResult ShowWizardPage()
        {
            var temp=this.DataContext;
            this.DataContext=null;
            this.DataContext = temp;
            this.ShowDialog();
            return result;
        }

        private void buttonAbort_Click(object sender, RoutedEventArgs e)
        {
            result = WizardFormResult.Abort;
            this.Close();
        }

        private void buttonBack_Click(object sender, RoutedEventArgs e)
        {
            result = WizardFormResult.Back;
            this.Close();
        }
        private void buttonFinish_Click(object sender, RoutedEventArgs e)
        {
            result = WizardFormResult.Finish;
            this.Close();

        }

    }
}
